---
id: "send-decorator"
keywords: ["send", "decorator"]
name: "@send"
summary: "This is the `@send` decorator."
category: "decorators"
---

The `@send` decorator is used to bind to a method on an object or array.

### Example

<CodeTab labels={["ReScript", "JS Output"]}>

```res

// Bind to a method on an object
type document
@send external getElementById: (document, string) => Dom.element = "getElementById"
@val external doc: document = "document"
let el = getElementById(doc, "myId")

// Bind to a method on an array
@send external fillInPlace: (array<'a>, 'a) => array<'a> = "fill"
let a = fillInPlace([1, 2, 3], 99)
```

```js
var el = document.getElementById("myId");

var a = [1, 2, 3].fill(99);
```

</CodeTab>

### References

- [Bind to JS function](../docs/manual/bind-to-js-function.mdx)
